Kinetis SDK API Reference Manual  1.0.0-beta
Freescale Semiconductor, Inc.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Interrupt Manager (Interrupt)

The Kinetis SDK Interrupt Manager provides a set of API/services to configure the Interrupt Controller (NVIC). More...

interrupt_manager APIs

void interrupt_register_handler (IRQn_Type irqNumber, void(*handler)(void))
 Installs an interrupt handler routine for a given IRQ number. More...
 
static void interrupt_enable (IRQn_Type irqNumber)
 Enables an interrupt for a given IRQ number. More...
 
static void interrupt_disable (IRQn_Type irqNumber)
 Disables an interrupt for a given IRQ number. More...
 
void interrupt_enable_global (void)
 Enables system interrupt. More...
 
void interrupt_disable_global (void)
 Disable system interrupt. More...
 

Interrupt Manager

Overview

The Interrupt Manager provides a set of APIs so that the application can enable or disable an interrupt for a specific device and also set/get interrupt status, priority and other features. Also it provides a way to update the vector table for a specific device interrupt handler.

Interrupt Names

Each chip has its own set of supported interrupt names defined in the chip-specific header file. For example, for K70, the header file is MK70F12.h or MK70F15.h as an IRQn_Type.Example to set/update the vector table for the I2C0_IRQn interrupt handler:

interrupt_register_handler(I2C0_IRQn, irq_handler_I2C0_IRQn);
Example to enable/disable an interrupt for the I2C0_IRQn

Function Documentation

void interrupt_register_handler ( IRQn_Type  irqNumber,
void(*)(void)  handler 
)

This function lets the application register/replace the interrupt handler for a specified IRQ number. The IRQ number is different than the vector number. IRQ 0 starts from the vector 16 address. See a chip-specific reference manual for details and the startup_MKxxxx.s file for each chip family to find out the default interrupt handler for each device. This function converts the IRQ number to the vector number by adding 16 to it.

Parameters
irqNumberIRQ number
handlerInterrupt handler routine address pointer
static void interrupt_enable ( IRQn_Type  irqNumber)
inlinestatic

This function enables the individual interrupt for a specified IRQ number. It calls the system NVIC API to access the interrupt control register. The input IRQ number does not include the core interrupt, only the peripheral interrupt, from 0 to a maximum supported IRQ.

Parameters
irqNumberIRQ number
static void interrupt_disable ( IRQn_Type  irqNumber)
inlinestatic

This function enables the individual interrupt for a specified IRQ number. It calls the system NVIC API to access the interrupt control register.

Parameters
irqNumberIRQ number
void interrupt_enable_global ( void  )

This function enables the global interrupt by calling the core API.

void interrupt_disable_global ( void  )

This function disables the global interrupt by calling the core API.